@extends('layouts.mobile_main')

@section('title', '身份验证')

@section('resources')
    @parent
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link rel="stylesheet" href="{{ env('CSS_DOMAIN') }}/css/public.css?v={{env('CSS_VERSION')}}">
    <script src="{{ env('JS_DOMAIN') }}/js/adaptation.js?v={{env('JS_VERSION')}}"></script>
@endsection

@section('content')
<div class="paysu_outer">
	<header class="pay_sure oh" style="background-color: #fff;">
		<a class="fl" href="javascript:history.go(-1);">
		<img class="fl" src="{{env('IMAGE_DOMAIN')}}/images/back_p.png?v={{env('IMAGE_VERSION')}}" alt=""></a>
		<span class="fl co_violet fz_48">身份验证</span>
	</header>
	<section>
		<p class="fz_36" style="height: 0.8rem;line-height: 0.8rem;margin-left: 0.6rem;color: #ff4b4c;">请输入实名信息确保是本人操作</p>
		<!--
		<form method="post" action="" class="pay_idcheck_form">
			<ul>
				<li class="oh">
					<span class="fz_44 fl">真实姓名</span>
					<input class="fl fz_40" type="text" placeholder="请填写你的真实姓名" name="realname" value="{{$realname}}">
				</li>
				<li class="oh">
					<span class="fz_44 fl">身份证号</span>
					<input class="fl fz_40" type="text" placeholder="请填写你的身份证号" name="identitycard" value="{{$identitycard}}">
				</li>
			</ul>
			@if($realname == '')
			    <input type="submit" value="下一步" id="entry_sub">
			@endif
		</form>
		-->
		@if($type == 'resetpaypassword')
		    {!! Form::open(array('action' => 'MobileWeb\MyCenterController@verifyIdentity','method'=>'post','class'=>'pay_idcheck_form')) !!}
		@else
			{!! Form::open(array('action' => 'MobileWeb\MyCenterController@saveIdentity','method'=>'post','class'=>'pay_idcheck_form')) !!}
        @endif
                <ul>
                    <li class="oh">
                        {!! Form::label('realname', '真实姓名', ['class'=>'fz_44 fl truename']) !!}
                        {!! Form::text('realname', $realname, ['class' => 'fl fz_40', 'required'=>'required', 'oninput'=>'durn()', 'onpropertychange'=>'durn()'] ) !!}
                    </li>
                    <li class="oh">
                        {!! Form::label('identitycard', '身份证号', ['class'=>'fz_44 fl idcard'] ) !!}
                        {!! Form::text('identitycard', $identitycard, ['class' => 'fl fz_40', 'required'=>'required','autocomplete'=>"off", 'oninput'=>'durn()', 'onpropertychange'=>'durn()'] ) !!}
                    </li>
                </ul>
                  @if($realname == '')
                  {!! Form::submit('提交', ['class' => 'btn btn-primary form-control','id'=>"entry_sub"]) !!}
                  @endif
            {!! Form::close() !!}

            @if(isset($message) && ($message!=''))
                <span style="width: 100%;" class="fl fz_36 co_orange tc">{{$message}}</span>
            @endif
	</section>
</div>
@endsection

@section('scriptResources')
    @parent
    <script>
	    window.onresize=function(){
		    pagesp();
	    }
	    $(function(){
		    var paysu_outer_h=$(window).height();
		    $(".paysu_outer").css({"min-height":paysu_outer_h});
	    })
	    function durn(){
	    	if(($("#realname").val()!="")&&($("#identitycard").val()!="")){
		    	$(".btn-primary").css("background","#9955c6")
		    }else{
		    	$(".btn-primary").css("background","#ccc")
		    }
	    }
	    if(/msie/i.test(navigator.userAgent))    //ie浏览器   
	        {document.getElementById('realname').onpropertychange=durn   
	    } else{//非ie浏览器，比如Firefox   
	        document.getElementById('realname').addEventListener("input",durn,false);   
	    }
	    if(/msie/i.test(navigator.userAgent))    //ie浏览器   
	        {document.getElementById('identitycard').onpropertychange=durn   
	    } else{//非ie浏览器，比如Firefox   
	        document.getElementById('identitycard').addEventListener("input",durn,false);   
	    }   
    </script>
@endsection